package weekend01;

import java.util.Arrays;

public class StringDemo01 {
    public static void main(String[] args) {
        String email = "fssa@fs4as.asfa";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match = email.matches(regex);
        if(match){
            System.out.println("格式正确");
        }else {
            System.out.println("格式错误");
        }

        System.out.println(email.replaceAll("[a-zA-Z]", "*"));

        System.out.println(Arrays.toString(email.split("\\.")));

        String str1 = new String("hello");
        String str2 = new String("hello");
        System.out.println(str1 == str2);
        System.out.println(str1.equals(str2));

        Integer i1 = new Integer(5);
        Integer i2 = new Integer(5);
        System.out.println(i1 == i2);
        System.out.println(i1.equals(i2));

        Integer i3 = Integer.valueOf(5);
        Integer i4 = Integer.valueOf(5);
        System.out.println(i3 == i4);
        System.out.println(i3.equals(i4));

        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;
        System.out.println("max="+max+",min="+min);
    }
}
